package com.elitesland.org.repo;

import com.elitesland.org.entity.OrgOuDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrgOuRepo extends JpaRepository<OrgOuDO, Long>, QuerydslPredicateExecutor<OrgOuDO> {

    List<OrgOuDO> findAllByPathLikeOrderByCode(String path);

    List<OrgOuDO> findAllByParentId(Long pId);

    List<OrgOuDO> findAllByIdIn(List<Long> ids);

    void deleteAllByPathLike(String path);

    OrgOuDO findByCode(String code);
}
